package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: 刘安杰
 * @Date: 2024/8/14
 * @Time: 18:22
 * @Description:
 */
//自定义的异常类
    @AllArgsConstructor//有(全)参构造
    @NoArgsConstructor//无参构造
    @Data
public class LeaseException extends RuntimeException{
        private Integer code;
        private String message;

        //构造方法
    public LeaseException(ResultCodeEnum resultCodeEnum){
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
